"use strict";

var itemIndex = -1;
var isInLeft = true;
var owner = true;
function MouseOver(){
	// $.DispatchEvent("UIShowCustomLayoutParametersTooltip", "CustomItemNode",
	// 		"file://{resources}/layout/custom_game/CustomItemNode.xml",
	// 		"itemIndex=" + itemIndex);
}

function MouseOut(){
	// $.DispatchEvent( "UIHideCustomLayoutTooltip", "CustomItemNode");
}

function SetItemIndex(val){
	itemIndex = val;
}

function SetItemType(val){
	isInLeft = val;
}

function SetItemName(val){
	$('#lb_city_name').text = "  "+$.Localize(val)+"  ";
}

function GetItemName(){
	return $('#lb_city_name').text;
}

function SetItemOwner(val){
	owner = val;
}
function GetItemIndex(){
	return itemIndex;
}

//点击了地皮，将其放入到待交易的区域
function ClickGood(){
	if (isInLeft) {
		GameEvents.SendCustomGameEventToServer( "C2S_PUSH_GOODS", {itemIndex:itemIndex,owner:owner} );
	}else{
		//不能退下物品，只能重新交易，采用问道的交易模式
		//GameEvents.SendCustomGameEventToServer( "C2S_POP_GOODS", {itemIndex:itemIndex} );
	}
}
function GetItemOwner(){
	return owner;
}
(function()
{
	$.GetContextPanel().GetItemName = GetItemName;
	$.GetContextPanel().GetItemIndex = GetItemIndex;
	$.GetContextPanel().SetItemIndex = SetItemIndex;
	$.GetContextPanel().SetItemType = SetItemType;
	$.GetContextPanel().SetItemName = SetItemName;
	$.GetContextPanel().SetItemOwner = SetItemOwner;
})();